#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
	char str[100];
	int count = 0;
	printf("string:");
	fgets(str, 100, stdin);
	int i = 0;
	while (str[i] != '\0') {
		if (str[i] == 32) {
			count++;
		}
		i++;
	}
	printf("words=%d\n", str[0] == '\n' ? count : count + 1);
	return 0;
}